package jdbc;
import jdbc.InputUtil.InputField;
public class UserInfo {
    @InputField(notNull = true,regexNotMathTitle = "用户名格式不正确",mode ={"修改密码","登录","注册"} )
    private String username;
    @InputField(mode={"修改密码","登录","注册"})
    private String password;
    @InputField(notNull = true,regexNotMathTitle = "密码格式不正确",mode="修改密码" )
    private String newPassword;
    @InputField(mode="注册")
    private  String nickname;
    @InputField(mode="注册")
    private int age;

    public UserInfo() {

    }

    public String getNewPassword() {
        return newPassword;
    }

    public void setNewPassword(String newPassword) {
        this.newPassword = newPassword;
    }

    public UserInfo(String newPassword) {
        this.newPassword = newPassword;
    }

    public String getUsername() {

        return username;

    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public UserInfo(String username, String password, String nickname, int age) {
        this.username = username;
        this.password = password;
        this.nickname = nickname;
        this.age = age;
    }

    @Override
    public String toString() {
        return "UserInfo{" +
                "username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", newPassword='" + newPassword + '\'' +
                ", nickname='" + nickname + '\'' +
                ", age=" + age +
                '}';
    }
}
